package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.domain.SysBackApply;
import com.ruoyi.system.mapper.SysBackApplyMapper;
import com.ruoyi.system.service.ISysBackApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 赎回申请Service业务层处理
 * 
 * @author paul
 * @date 2023-06-25
 */
@Service
public class SysBackApplyServiceImpl implements ISysBackApplyService
{
    @Resource
    private SysBackApplyMapper sysBackApplyMapper;

    /**
     * 查询赎回申请
     * 
     * @param id 赎回申请主键
     * @return 赎回申请
     */
    @Override
    public SysBackApply selectSysBackApplyById(Long id)
    {
        return sysBackApplyMapper.selectSysBackApplyById(id);
    }

    /**
     * 查询赎回申请列表
     * 
     * @param sysBackApply 赎回申请
     * @return 赎回申请
     */
    @Override
    public List<SysBackApply> selectSysBackApplyList(SysBackApply sysBackApply)
    {
        return sysBackApplyMapper.selectSysBackApplyList(sysBackApply);
    }

    /**
     * 新增赎回申请
     * 
     * @param sysBackApply 赎回申请
     * @return 结果
     */
    @Override
    public int insertSysBackApply(SysBackApply sysBackApply)
    {
        sysBackApply.setCreateTime(DateUtils.getNowDate());
        return sysBackApplyMapper.insertSysBackApply(sysBackApply);
    }

    /**
     * 修改赎回申请
     * 
     * @param sysBackApply 赎回申请
     * @return 结果
     */
    @Override
    public int updateSysBackApply(SysBackApply sysBackApply)
    {
        sysBackApply.setUpdateTime(DateUtils.getNowDate());
        return sysBackApplyMapper.updateSysBackApply(sysBackApply);
    }

    /**
     * 批量删除赎回申请
     * 
     * @param ids 需要删除的赎回申请主键
     * @return 结果
     */
    @Override
    public int deleteSysBackApplyByIds(Long[] ids)
    {
        return sysBackApplyMapper.deleteSysBackApplyByIds(ids);
    }

    /**
     * 删除赎回申请信息
     * 
     * @param id 赎回申请主键
     * @return 结果
     */
    @Override
    public int deleteSysBackApplyById(Long id)
    {
        return sysBackApplyMapper.deleteSysBackApplyById(id);
    }
}
